[WIP] Add Storybook reproduction for SelectPanel screen-reader announcement bug - #8407
siddharthkp with Copilot wants to merge 3 commits into
Conversation
|
Co-authored-by: siddharthkp <1863771+siddharthkp@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Adds a Storybook-only reproduction (no fix) for a SelectPanel screen-reader announcement bug.
Actual behavior
When a
<live-region>element exists inside a closed native<dialog>earlier in the DOM, SelectPanel'sFilteredActionList/useAnnouncementspath finds it viadocument.querySelector('live-region')and writes announcements there. A closed<dialog>isdisplay: noneand excluded from the accessibility tree, so the empty-state message ("No language found for…") is never announced by a screen reader.Expected behavior
The empty-state message should be announced when the filter returns no results, regardless of unrelated live regions elsewhere on the page.
Control case
Unchecking the checkbox removes the closed-dialog live region; SelectPanel then falls back to creating/using a body-level live region and the message is announced correctly.
Reproduction only
No announcement logic is added in the story and no fix is included in this PR — the story exercises SelectPanel's existing announcement path.
WithLiveRegionInsideClosedDialogstory toSelectPanel.dev.stories.tsx(copied from the simplest existing searchable dev story)<live-region />inside a closed<dialog><p>above the demoprettier --check,tsc --noEmit,eslint,storybook.test.tsx,SelectPanel.test.tsxskip changesetlabel)Original prompt